﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="WebSite.Models" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <base target="_self" />
    <title>上传</title>
    <style type="text/css">
    .ResultTable
    {
        background-color:White;
        font-size:9pt;
    } 
    .ResultTable_Thead td
    {
        background-color:#999999;
        padding:5px;
        white-space:nowrap;
    }
    .ResultTable_Lv1 td
    {
        background-color:#CCCCCC;
        padding:5px;
    }
    .ResultTable_Lv2 td
    {
        background-color:#DDDDDD;
        padding:5px;
    }
    .ResultTable_Lv3 td
    {
        background-color:#EEEEEE;
        padding:5px;
    }
    
</style>
</head>
<body>
    <div style=" padding:20px">
        <% using (Html.BeginForm("UploadData", "Budget", FormMethod.Post, new { enctype = "multipart/form-data" }))
        { %>
        <input name="uploadDataFile" type="file" />
        <input type="submit" value="上传" />
        <%} %>
        
        
<% if (ViewData["UploadResult"] != null) {

    List<SheetModel> Xls = (List<SheetModel>)ViewData["UploadResult"];

    foreach (SheetModel OneXls in Xls)
    {
        %>
            <table class="ResultTable" border="0" cellpadding="0" cellspacing="1">
                <tr><td colspan="6"><b>当年预算支出明细</b></td></tr>
                <tr class="ResultTable_Thead">
                    <td>序号</td>
                    <td>支出品名</td>
                    <td>数量</td>
                    <td>单价</td>
                    <td>金额</td>
                    <td>备注</td>
                </tr>
        <%
        foreach (DetailModel Item in OneXls.DetailList)
        {
            %>
                <% if (Item.Lv == 1) { %><tr class="ResultTable_Lv1"><% } %>
                <% if (Item.Lv == 2) { %><tr class="ResultTable_Lv2"><% } %>
                <% if (Item.Lv == 3) { %><tr class="ResultTable_Lv3"><% } %>
                    <td><%=Item.Number %></td>
                    <td>
                        <% if (Item.Lv == 1)
                            { %><b><%=Item.Name%></b><% } %>
                        <% else { %><%=Item.Name %><% } %>
                    </td>
                    <td><%=Item.Count %></td>
                    <td><%=Item.Price %></td>
                    <td><%=Item.Amount %></td>
                    <td><%=Item.Rem %></td>
                </tr>
            <%
        }
                
        %>
            </table>
        <%
    }            
}
%>  
    </div>
</body>
</html>
